#include "applyfriendresponsemessagetoserver.h"


ApplyFriendResponseMessageToServer::ApplyFriendResponseMessageToServer(const Status& status, const Alias& alias, const Id& id)
{
    m_messageType = MessageType::ApplyFriendResponseToServer;
    m_status = status;
    m_alias = alias;
    m_id = id;
}

ApplyFriendResponseMessageToServer::ApplyFriendResponseMessageToServer(const QJsonObject& jsonObj)
{
    m_messageType = static_cast<MessageType>(jsonObj[JsonKey::TYPE].toInt());
    m_status = jsonObj[JsonKey::STATUS].toString();
    m_alias = jsonObj[JsonKey::ALIAS].toString();
    m_id = jsonObj[JsonKey::ID].toInt();
}

QJsonObject ApplyFriendResponseMessageToServer::PackJsonData() const
{
    QJsonObject jsonObj;
    jsonObj[JsonKey::TYPE] = static_cast<int>(m_messageType);
    jsonObj[JsonKey::STATUS] = m_status;
    jsonObj[JsonKey::ALIAS] = m_alias;
    jsonObj[JsonKey::ID] = m_id;
    return jsonObj;
}

Status ApplyFriendResponseMessageToServer::getStatus() const
{
    return m_status;
}

Alias ApplyFriendResponseMessageToServer::getAlias() const
{
    return m_alias;
}

Id ApplyFriendResponseMessageToServer::getId() const
{
    return m_id;
}
